#!/bin/bash
echo "Please input directory name..."
read directory
if [ -d ${directory} ]
then
		mkdir -p /home/zhangliang/zipfile
		zip=/home/zhangliang/zipfile
		echo "input y or n to confirm"
		read confirm
		if [ $confirm = y ]
		then
				date=`date +"%y-%m-%d_%H=%M=%S"`
				echo "Is backup, please wait a moment"
				tar -cpzvf ${zip}/${directory}${date}.tar.gz ${directory}
			echo "Backup complete.."
		else
			exit
		fi
else
	echo "${directory} is not directory or exist"
fi
